package iwpl.project.entities;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Equipments entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Equipments")
public class Equipments implements java.io.Serializable {

	// Fields

	private Integer id;
	private String equipmentName;
	private Timestamp maintainDate;
	private Timestamp producDate;
	private Timestamp enpiratyDate;
	private Set<EquipmentDetails> equipmentDetailses = new HashSet<EquipmentDetails>(
			0);

	// Constructors

	/** default constructor */
	public Equipments() {
	}

	/** minimal constructor */
	public Equipments(Integer id) {
		this.id = id;
	}

	/** full constructor */
	public Equipments(Integer id, String equipmentName, Timestamp maintainDate,
			Timestamp producDate, Timestamp enpiratyDate,
			Set<EquipmentDetails> equipmentDetailses) {
		this.id = id;
		this.equipmentName = equipmentName;
		this.maintainDate = maintainDate;
		this.producDate = producDate;
		this.enpiratyDate = enpiratyDate;
		this.equipmentDetailses = equipmentDetailses;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "EquipmentName")
	public String getEquipmentName() {
		return this.equipmentName;
	}

	public void setEquipmentName(String equipmentName) {
		this.equipmentName = equipmentName;
	}

	@Column(name = "MaintainDate", length = 16)
	public Timestamp getMaintainDate() {
		return this.maintainDate;
	}

	public void setMaintainDate(Timestamp maintainDate) {
		this.maintainDate = maintainDate;
	}

	@Column(name = "ProducDate", length = 16)
	public Timestamp getProducDate() {
		return this.producDate;
	}

	public void setProducDate(Timestamp producDate) {
		this.producDate = producDate;
	}

	@Column(name = "EnpiratyDate", length = 16)
	public Timestamp getEnpiratyDate() {
		return this.enpiratyDate;
	}

	public void setEnpiratyDate(Timestamp enpiratyDate) {
		this.enpiratyDate = enpiratyDate;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "equipments")
	public Set<EquipmentDetails> getEquipmentDetailses() {
		return this.equipmentDetailses;
	}

	public void setEquipmentDetailses(Set<EquipmentDetails> equipmentDetailses) {
		this.equipmentDetailses = equipmentDetailses;
	}

}